<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePostThreadTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		// 这个表格保存了被律师抢到单的咨询
		Schema::create('post_thread', function(Blueprint $table){
			$table->increments('id');
			$table->integer('post_id');	// 咨询id
			$table->integer('user_id'); // 回复咨询的律师用户的id
            $table->unique(array('post_id', 'user_id'));
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('post_thread');
	}

}
